Animating
a Palette
The following
example animates a palette by using the DrawDibRealize
You can
change the colors of a bitmap by using the DrawDibBegin
For example,
if lppe is an address of the PALETTEENTRY80WU3I array containing the new colors, and lpbi
is the LPBITMAPINFOHEADER structure used in DrawDibBegin or DrawDibDraw,
the following fragment updates the DIB color table.
hdc = GetDC(hwnd);
DrawDibBegin(hdd, ....., DDF_ANIMATE);
DrawDibRealize(hdd, hdc, fBackground);
DrawDibDraw(hdd, hdc, ....,
DDF_SAME_DRAW|DDF_SAME_HDC);
// Call to change color.
DrawDibChangePalette(hDD, iStart, iLen, lppe);
.
.
.
ReleaseDC(hwnd, hdc);